/*
 * ColorRenderer.java
 *
 * Created on 8 de febrero de 2008, 12:38
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package utiles;
import javax.swing.*;
import javax.swing.table.*;
import java.awt.*;
import java.awt.event.*; 
/**
 *
 * @author desarrollo-vane
 */
public class ColorRenderer extends DefaultTableCellRenderer {
    public Component getTableCellRendererComponent(
              JTable table, Object value, boolean isSelected, 
                                       boolean hasFocus, int row, int column) {

      super.getTableCellRendererComponent(
                            table, value, isSelected, hasFocus, row, column);        
      Double total = (Double)table.getModel().getValueAt(row, 2);
      if(isSelected == true){
          setBackground(Color.RED);
      } else{
          setBackground(Color.BLUE);
      }
        
        return this;
    }
}